package com.freecloud.javabasics.constructor;

/**
 * 父类不设定无参构造函数，子类也无法创建无参构造函数
 * @Author: maomao
 * @Date: 2021-04-26 08:13
 */
public class ParentConstructorTest {


    public static void main(String[] args) {
        WhiteDog dog = new WhiteDog("小白");
    }
}


class Dog{
    //public Dog(){}
    public Dog(String name){
        System.out.println("dog:" + name);
    }
}

class WhiteDog extends Dog {

    public WhiteDog(){
        System.out.println("WhiteDog:");
        super("");
    }

    public WhiteDog(String name) {
        super(name);
        System.out.println("WhiteDog:" + name);
    }
}